/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity_bean;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Mamoune
 */
@Entity
@Table(name = "competence")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Competence.findAll", query = "SELECT c FROM Competence c"),
    @NamedQuery(name = "Competence.findById", query = "SELECT c FROM Competence c WHERE c.id = :id"),
    @NamedQuery(name = "Competence.findByCOMPETENCEid", query = "SELECT c FROM Competence c WHERE c.cOMPETENCEid = :cOMPETENCEid"),
    @NamedQuery(name = "Competence.findByNomComp", query = "SELECT c FROM Competence c WHERE c.nomComp = :nomComp"),
    @NamedQuery(name = "Competence.findByTypeComp", query = "SELECT c FROM Competence c WHERE c.typeComp = :typeComp")})
public class Competence implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "id")
    private Integer id;
    @Column(name = "COMPETENCE_id")
    private Integer cOMPETENCEid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "nom_comp")
    private String nomComp;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2)
    @Column(name = "type_comp")
    private String typeComp;

    public Competence() {
    }

    public Competence(Integer id) {
        this.id = id;
    }

    public Competence(Integer id, String nomComp, String typeComp) {
        this.id = id;
        this.nomComp = nomComp;
        this.typeComp = typeComp;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getCOMPETENCEid() {
        return cOMPETENCEid;
    }

    public void setCOMPETENCEid(Integer cOMPETENCEid) {
        this.cOMPETENCEid = cOMPETENCEid;
    }

    public String getNomComp() {
        return nomComp;
    }

    public void setNomComp(String nomComp) {
        this.nomComp = nomComp;
    }

    public String getTypeComp() {
        return typeComp;
    }

    public void setTypeComp(String typeComp) {
        this.typeComp = typeComp;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Competence)) {
            return false;
        }
        Competence other = (Competence) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity_bean.Competence[ id=" + id + " ]";
    }
    
}
